<ion-view title="部门 / 门店" show-tabs>

  <ion-nav-buttons side="right">
    <a class="button button-icon ion-android-add" ui-sref="app.dept-add"></a>
  </ion-nav-buttons>

  <ion-content class="has-header">
      <ion-spinner icon="lines" ng-if="!deptTree.length" class="spinner-royal root-loading fade"></ion-spinner>

      <tree-view
        recursion-template='templates/common/model/list-tree.html',
        tree-data="deptTree"
        text-field="name"
        leaf-icon="ion-link"
        pre-href="department"
        value-field='_id'
        item-clicked="itemClicked($item)"
        item-checked-changed="itemCheckedChanged($item)"
        expend-all="expendAll(treeData)"
        can-checked="true">
      </tree-view>
      <a class="button button-block button-balanced" ui-sref="app.dept-add"><i class="ion-plus"></i> 添 加</a>
  </ion-content>
</ion-view>
